export default () => {
  // 验证el-form 表单 ，传入 绑定 ref
  const validForm = (formRef) => {
    if (!formRef) return
    return new Promise((resolve, rejects) => {
      formRef.validate((valid, fields) => {
        if (valid) {
          resolve()
        } else {
          rejects()
        }
      })
    })
  }
  return {
    validForm
  }
}
